<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase" :title="mixinEdit_editTitle" width="900px" :visible.sync="mixinEdit_editVisible"
    :before-close="function(){mixinEdit_editBoxClose('editForm')}" append-to-body>
    <div class="dialogStyleBaseBox" v-loading="mixinEdit_loading">
        <el-form ref="editForm" :model="form" label-width="140px" label-position="left">
            <LayoutCell>
                <LayoutCellItem title="等级佣金比例">
                    <el-form-item label="等级" prop="name" :rules="{ required: true, message: '等级名称 不能为空'}">
                        <el-button :class="{level: item.value == form.distribution_level_weight_id}" v-for="item in levelList" @click="addLevel(item.value)" :disabled="item.used">{{ item.level_text || item.value_text }}</el-button>
                    </el-form-item>
                    <el-form-item label="等级名称" prop="name" :rules="{ required: true, message: '等级名称 不能为空'}">
                        <el-input style="width: 300px;" v-model="form.name" maxlength="10" show-word-limit></el-input>
                    </el-form-item>
                    <el-form-item label="一级佣金比例" prop="commission_1" :rules="{ required: true, message: '一级佣金比例 不能为空'}" v-if="levelCommission >= 1">
                        <el-input style="width: 300px;" v-model="form.commission_1"><template slot="append">%</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="二级佣金比例" prop="commission_2" :rules="{ required: true, message: '二级佣金比例 不能为空'}" v-if="levelCommission >= 2">
                        <el-input style="width: 300px;" v-model="form.commission_2"><template slot="append">%</template>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="三级佣金比例" prop="commission_3" :rules="{ required: true, message: '三级佣金比例 不能为空'}" v-if="levelCommission >= 3">
                        <el-input style="width: 300px;" v-model="form.commission_3"><template slot="append">%</template>
                        </el-input>
                    </el-form-item>
                </LayoutCellItem>
            </LayoutCell>

            <LayoutCellItem title="添加升级条件" v-if="form.default == 0">
                <el-form-item label="升级方式">
                    <el-radio-group v-model="form.upgrade_type">
                        <el-radio :label="1">满足以下任意条件</el-radio>
                        <el-radio :label="2">满足以下全部条件</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item>
                    <div class="condition-style" :class="{active : form.extra.includes(index)}" v-for="(item, index) in conditionList" @click="select(item, index)">{{ item }}</div>
                </el-form-item>
            </LayoutCellItem>

            <LayoutCellItem title="升级条件限制" v-if="form.default == 0">
                <el-form-item label="下线分销商人数" prop="child_agent_count" :rules="{ required: true, message: '下线分销商人数 不能为空'}" v-if="form.extra.includes(0)">
                    <el-input style="width: 300px;" v-model="form.child_agent_count"><template slot="append">人</template></el-input><span class="del" @click="del(0, 'child_agent_count')">删除</span>
                </el-form-item>
                <el-form-item label="一级下线分销商" prop="child_agent_count_1" :rules="{ required: true, message: '一级下线分销商 不能为空'}" v-if="form.extra.includes(1)">
                    <el-input style="width: 300px;" v-model="form.child_agent_count_1"><template slot="append">人</template></el-input><span class="del" @click="del(1, 'child_agent_count_1')">删除</span>
                </el-form-item>
                <el-form-item label="下线人数" prop="child_count" :rules="{ required: true, message: '下线人数 不能为空'}" v-if="form.extra.includes(2)">
                    <el-input style="width: 300px;" v-model="form.child_count"><template slot="append">人</template></el-input><span class="del" @click="del(2, 'child_count')">删除</span>
                </el-form-item>
                <el-form-item label="一级下线人数" prop="child_count_1" :rules="{ required: true, message: '一级下线人数 不能为空'}" v-if="form.extra.includes(3)">
                    <el-input style="width: 300px;" v-model="form.child_count_1"><template slot="append">人</template></el-input><span class="del" @click="del(3, 'child_count_1')">删除</span>
                </el-form-item>
                <el-form-item label="分销订单总数" prop="order_count" :rules="{ required: true, message: '分销订单总数 不能为空'}" v-if="form.extra.includes(4)">
                    <el-input style="width: 300px;" v-model="form.order_count"><template slot="append">个</template></el-input><span class="del" @click="del(4, 'order_count')">删除</span>
                </el-form-item>
                <el-form-item label="一级分销订单总数" prop="order_count_1" :rules="{ required: true, message: '一级分销订单总数 不能为空'}" v-if="form.extra.includes(5)">
                    <el-input style="width: 300px;" v-model="form.order_count_1"><template slot="append">个</template></el-input><span class="del" @click="del(5, 'order_count_1')">删除</span>
                </el-form-item>
                <el-form-item label="分销订单总额" prop="order_money" :rules="{ required: true, message: '分销订单总额 不能为空'}" v-if="form.extra.includes(6)">
                    <el-input style="width: 300px;" v-model="form.order_money"><template slot="append">元</template></el-input><span class="del" @click="del(6, 'order_money')">删除</span>
                </el-form-item>

                <el-form-item label="一级分销订单总额" prop="order_money_1" :rules="{ required: true, message: '一级分销订单总额 不能为空'}" v-if="form.extra.includes(7)">
                    <el-input style="width: 300px;" v-model="form.order_money_1"><template slot="append">元</template></el-input><span class="del" @click="del(7, 'order_money_1')">删除</span>
                </el-form-item>
                <el-form-item label="自购订单总数" prop="self_order_count" :rules="{ required: true, message: '自购订单总数 不能为空'}" v-if="form.extra.includes(8)">
                    <el-input style="width: 300px;" v-model="form.self_order_count"><template slot="append">个</template></el-input><span class="del" @click="del(8, 'self_order_count')">删除</span>
                </el-form-item>
                <el-form-item label="自购订单总额" prop="self_order_money" :rules="{ required: true, message: '自购订单总额 不能为空'}" v-if="form.extra.includes(9)">
                    <el-input style="width: 300px;" v-model="form.self_order_money"><template slot="append">元</template></el-input><span class="del" @click="del(9, 'self_order_money')">删除</span>
                </el-form-item>
                <el-form-item label="已提现佣金金额" prop="withdraw_money" :rules="{ required: true, message: '已提现佣金金额 不能为空'}" v-if="form.extra.includes(10)">
                    <el-input style="width: 300px;" v-model="form.withdraw_money"><template slot="append">元</template></el-input><span class="del" @click="del(10, 'withdraw_money')">删除</span>
                </el-form-item>
                <el-form-item label="单笔充值金额" prop="recharge_money" :rules="{ required: true, message: '单笔充值金额 不能为空'}" v-if="form.extra.includes(11)">
                    <el-input style="width: 300px;" v-model="form.recharge_money"><template slot="append">元</template></el-input><span class="del" @click="del(11, 'recharge_money')">删除</span>
                </el-form-item>
                <el-form-item label="购买指定商品" prop="goods_ids" :rules="{ required: true, message: '购买指定商品 不能为空'}" v-if="form.extra.includes(12)">
                    <div style="display: flex;">
                        <SelectDataGoods v-model="form.goods_ids" :appWindow="appWindow" :count="100" style="width: 90%;"
                            :apiConfig="$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataGoods',appWindow)" :showDelete="mixinEdit_editType != 'update'">
                        </SelectDataGoods><span class="del" @click="del(12, 'goods_ids')">删除</span>
                    </div>
                </el-form-item>
                <el-form-item label="累计充值金额" prop="all_recharge_money" :rules="{ required: true, message: '累计充值金额 不能为空'}" v-if="form.extra.includes(13)">
                    <el-input style="width: 300px;" v-model="form.all_recharge_money"><template slot="append">元</template></el-input><span class="del" @click="del(13, 'all_recharge_money')">删除</span>
                </el-form-item>
            </LayoutCellItem>
        </el-form>
    </div>
    <div slot="footer">
        <el-row>
            <el-col :span="12" style="text-align: left;">
                <el-button :disabled="mixinEdit_loading" @click="mixinEdit_resetForm('editForm')">重 置</el-button>
            </el-col>
            <el-col :span="12">
                <el-button :disabled="mixinEdit_loading" @click="mixinEdit_editBoxClose('editForm')">取 消</el-button>
                <el-button :disabled="mixinEdit_loading" type="primary"
                    @click="mixinEdit_editFormSubmit({model:'form',ref:'editForm'})">确
                    定</el-button>
            </el-col>
        </el-row>
    </div>
</el-dialog>